package com.ktgj.flight.service.impl;

import java.util.List;
import com.ktgj.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ktgj.flight.mapper.FlightOrderAssistMapper;
import com.ktgj.flight.domain.FlightOrderAssist;
import com.ktgj.flight.service.IFlightOrderAssistService;

/**
 * 机票订单辅营产品Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-04-28
 */
@Service
public class FlightOrderAssistServiceImpl implements IFlightOrderAssistService 
{
    @Autowired
    private FlightOrderAssistMapper flightOrderAssistMapper;

    /**
     * 查询机票订单辅营产品
     * 
     * @param id 机票订单辅营产品ID
     * @return 机票订单辅营产品
     */
    @Override
    public FlightOrderAssist selectFlightOrderAssistById(Long id)
    {
        return flightOrderAssistMapper.selectFlightOrderAssistById(id);
    }

    /**
     * 查询机票订单辅营产品列表
     * 
     * @param flightOrderAssist 机票订单辅营产品
     * @return 机票订单辅营产品
     */
    @Override
    public List<FlightOrderAssist> selectFlightOrderAssistList(FlightOrderAssist flightOrderAssist)
    {
        return flightOrderAssistMapper.selectFlightOrderAssistList(flightOrderAssist);
    }

    /**
     * 新增机票订单辅营产品
     * 
     * @param flightOrderAssist 机票订单辅营产品
     * @return 结果
     */
    @Override
    public int insertFlightOrderAssist(FlightOrderAssist flightOrderAssist)
    {
        flightOrderAssist.setCreateTime(DateUtils.getNowDate());
        return flightOrderAssistMapper.insertFlightOrderAssist(flightOrderAssist);
    }

    /**
     * 修改机票订单辅营产品
     * 
     * @param flightOrderAssist 机票订单辅营产品
     * @return 结果
     */
    @Override
    public int updateFlightOrderAssist(FlightOrderAssist flightOrderAssist)
    {
        return flightOrderAssistMapper.updateFlightOrderAssist(flightOrderAssist);
    }

    /**
     * 批量删除机票订单辅营产品
     * 
     * @param ids 需要删除的机票订单辅营产品ID
     * @return 结果
     */
    @Override
    public int deleteFlightOrderAssistByIds(Long[] ids)
    {
        return flightOrderAssistMapper.deleteFlightOrderAssistByIds(ids);
    }

    /**
     * 删除机票订单辅营产品信息
     * 
     * @param id 机票订单辅营产品ID
     * @return 结果
     */
    @Override
    public int deleteFlightOrderAssistById(Long id)
    {
        return flightOrderAssistMapper.deleteFlightOrderAssistById(id);
    }

    //根据机票订单明细id查询
    @Override
    public List<FlightOrderAssist> queryFlightOrderAssist(Long orderInfoTicketsId) {
        return flightOrderAssistMapper.queryFlightOrderAssist(orderInfoTicketsId);
    }
}
